#include <Timer.h>
#include "StorageVolumes.h"

configuration MainApp {

}

implementation {
	components MainAppC as App;
	components new TimerMilliC() as EventATimer;
	components new TimerMilliC() as PostTimer;
	components new AMSenderC(6);
	components new AMReceiverC(6);
	components ActiveMessageC;

	components DataC;
	components CC2420PacketC;
	App.Data->DataC;

	components MainC;
	App.Boot->MainC;

	components LEDC;
	App.LEDControl->LEDC;

	components LedsC;
	LEDC.Leds->LedsC;

	components UserButtonC;
	App.Button->UserButtonC;

	components SendC;
	SendC.LEDControl->LEDC;
	SendC.Packet->AMSenderC;
	SendC.AMPacket->AMSenderC;
	SendC.AMSend->AMSenderC;
	StatesC.AMControl->ActiveMessageC;
	App.SendControl->SendC;
	SendC.CC2420Packet->CC2420PacketC;

	components ReceiveC;
	ReceiveC.LEDControl->LEDC;
	ReceiveC.Receive->AMReceiverC;
	ReceiveC.Data->DataC;
	ReceiveC.CC2420Packet->CC2420PacketC;
	ReceiveC.StateDataInterface->StatesC;

	components PackageIDFifoC as ReceiveMissings;
	components PackageIDFifoC as PassiveQueueElements;
	components StatesC;
	StatesC.SendControl->SendC;
	StatesC.EventATimer->EventATimer;
	StatesC.PostTimer->PostTimer;
	App.StateInterface->StatesC;
	StatesC.ReceiveMissing->ReceiveMissings;
	StatesC.PassiveQueue->PassiveQueueElements;
	StatesC.DataControl->DataC;
	ReceiveMissings.LEDControl->LEDC;
	ReceiveMissings.Data->DataC;

	components PackageIDFifoC as Fifo;
	components new QueueingC(FifoData, 255) as Q;
	Fifo.Q->Q;
	StatesC.Fifo->Fifo;
	Fifo.LEDControl->LEDC;
	Fifo.Data->DataC;

}